package com.xbongbong.pro.message.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.pro.constant.CommonConstant;

/**
 * 推送设置，推送对象枚举
 * @author 魏荣杰
 * @date 2019/1/16 19:31
 * @since v1.0
 * @version v1.0
 */
public enum PushObjectTypeEnum {

	/**
	 * 创建人
	 */
	CREATOR("creator", CommonConstant.CREATOR, 1),
	MAINUSER("mainuser", CommonConstant.MAIN_USER, 2),
	COLLABORATOR("collaborator", CommonConstant.COLLABORATOR, 3),
	FROMHANDOVER("fromHandover", CommonConstant.FROM_HANDOVER, 4),
	TOHANDOVER("toHandover", CommonConstant.TO_HANDOVER, 5),
	EXECUTOR("executor", CommonConstant.EXECUTOR, 6),
	TODISTRBUTION("toDistrbution", CommonConstant.TO_DISTRIBUTION, 7),
	COMMENTATOR("commentator", CommonConstant.COMMENTATOR, 8),
	REPLYPEOPLE("replyPeople", CommonConstant.REPLY_PEOPLE, 9),
	FROMAPPROVER("fromApprover", CommonConstant.FROM_APPROVER, 10),
	TOAPPROVER("toApprover", CommonConstant.TO_APPROVER, 11),
	COPYER("copyer", CommonConstant.COPYER, 12),
	CUSTOMERMAINUSER("customerMainUser", CommonConstant.CUSTOMER_MAIN_USER, 13),
	CONTRACTMAINUSER("contractMainUser", CommonConstant.CONTRACT_MAIN_USER, 14),
	OPERATEDUSER("operatedUser", CommonConstant.OPERATED_USER, 15),
	CONTRACT_SIGNING("contractSigning", CommonConstant.CONTRACT_SIGNING, 16),
	QUOTATION_PERSON("quotationPerson", CommonConstant.QUOTATION_PERSON, 17),
    PURCHASE_SIGNING("purchaseSigning", CommonConstant.PURCHASE_SIGNING, 18),
	SUBMITTER("submitter", CommonConstant.SUBMITTER, 19),
	ORDER_SIGNING("orderSigning", CommonConstant.ORDER_SIGNING, 20),
	PUBLIC_GROUP_MANAGER("publicGroupManager", CommonConstant.PUBLIC_GROUP_MANAGER, 21),
	PUBLIC_GROUP_USER("publicGroupUser", CommonConstant.PUBLIC_GROUP_USER, 22),
	;
	//可更改的字段
	
	
	/** 枚举描述 --英文名称*/
	private final String alias;
	
	/** 枚举信息--中文名称 */
	private final String name;
	
	/** 枚举值 -- */
	private final int code;//此Enum里的code用来标记该字段是否可以更改
	
	/**
	 * 构造一个<code>PushObjectTypeEnum</code>枚举对象
	 *
	 * @param code
	 * @param name
	 * @param alias
	 */
	private PushObjectTypeEnum(String alias, String name, int code) {
		this.alias = alias;
		this.name = name;
		this.code = code;
	}

	/**
	 * @return Returns the code.
	 */
	public int getCode() {
		return code;
	}
	
	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return I18nMessageUtil.getMessage(name);
	}
	
	/**
	 * @return Returns the alias.
	 */
	public String getAlias() {
		return alias;
	}

}
